package com.cy.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProviderController {
    //@Value默认读取项目配置文件中配置的内容
    //8080为没有读到server.port的值时,给定的默认值
    @Value("${server.port}")
    private String server;
    @GetMapping("/provider/echo/{msg}")
    public String doRestEcho1(@PathVariable String msg){
        return server+" say hello "+msg;
    }

}
